import app from './app.js';
import { store, baseInfo } from './consts.js'
import { get, setParamToApi, api } from './net-utils.js';

import '../css/index.scss'

var navDiv = document.getElementById("nav")
var contentDiv = document.getElementById("content")

window.$store = store;

app.register(navDiv, contentDiv)
window.$store.converter = new showdown.Converter();

let baseParam = {
    owner: baseInfo.baseOwner,
    repo: baseInfo.baseRepositry,
}
let baseApi = setParamToApi(api.baseUrl, baseParam);
let rootApi = setParamToApi(baseApi, {sha: baseInfo.branch})
get(rootApi, {}).then(data => {
    console.log(data);
    app.renderNav(data)
})